<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="catalog" tagdir="/WEB-INF/tags/catalog"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="customer" tagdir="/WEB-INF/tags/customer"%>
<head>
	<title><fmt:message key="csConsult.title"/></title>
</head>

<%@include file="include/csConsultListTab.jspf" %>

<form>
	<c:forEach items="${consultList}" var="consult">
		<div class="ask_wrap clearfix">
			<%---------------------------------start:商品信息 -------------------------%>
			<div class="product">
				
				<a class="pict" target="blank" href="<product:productUrl product="${consult.product}"/>">
					<product:productImage product="${consult.product}" sizeType="s0" linkType="0"/>
				</a>	
				<h4>
					<a target="blank" href="<product:productUrl product="${consult.product}"/>">${consult.product.productName}</a>
				</h4>
			</div>
			<%---------------------------------end:  商品信息 -------------------------%>
			<div class="refer">
				<dl class="ask clearfix">
					<dt><fmt:message key="csConsult.consult.message"/>：</dt>
					<dd>${csConsult.consult.message}</dd>
					<dd class="writer">
						${consult.consultUserArea} ${consult.consultUserName}<br/> 
						<span class="time"><fmt:formatDate value="${consult.createTime}" pattern="yyyy-MM-dd HH:mm" /></span>
					</dd>
				</dl>
				<customer:getConsultReplys consultId="${consult.consultId}" returnReplyListName="replyList"/>
				<c:forEach items="${replyList}" var="reply" varStatus="replyStatus">
					<dl class="answer clearfix">
						<dt><fmt:message key="csConsult.consult.reply"/>：</dt><dd>${reply.message}</dd>
						<dd class="time"><fmt:formatDate value="${reply.createTime}" pattern="yyyy-MM-dd HH:mm" /></dd>
					</dl>
				</c:forEach>
				<c:if test="${empty replyList}">
					<dl class="answer clearfix">
						<dt><fmt:message key="csConsult.consult.reply.notYet"/>。</dt>
					</dl>
				</c:if>
				<div class="do">
					<fmt:message key="csConsult.consult.consultIsSatisfied"/>：
					<a class="satisfied" id="satisfiedFul_${consult.consultId}" href="javascript:void(0)"><fmt:message key="csConsult.consult.satisfied"/></a>(<span id="span_satisfiedCount_${consult.consultId}">${consult.satisfiedCount}</span>)
					<a class="dissatisfied" id="unsatisfiedFul_${consult.consultId}" href="javascript:void(0)"><fmt:message key="csConsult.consult.unsatisfied"/></a>(<span id="span_unsatisfiedCount_${consult.consultId}">${consult.unsatisfiedCount}</span>)
				</div>
			</div>
		</div>	
	</c:forEach>
	
	<c:if test="${empty consultList}">
		<div class="others_info2">
			<fmt:message key="consultList.noConsult"/>
		</div>
	</c:if>
	
	<%--------保存查询条件 -------%>
	<%@include file="include/consultSearchCriteriaStorage.jspf"%>
	<div class="page_bottom clearfix">
		<%@ include file="../common/pagingOnly.jsp"%>
	</div>
</form>

<c:set var="probizJs_validation" value="true" scope="request"/>	
<c:set var="probizJs_loginDlg" value="true" scope="request"/>	
<c:set var="probizJs_consult" value="true" scope="request"/>
<script type="text/javascript">
$j(document).ready(function () {
	<%--start:获取权限设定 --%>
	consultRight = '${appConfig.customerConsultRight}';	
	<%--end:  获取权限设定 --%>	
	<c:forEach items="${consultList}" var="consult">
		$j('#satisfiedFul_'+${consult.consultId}).bind('click',{"consultId":${consult.consultId},"chosen":1},consultVote);
		$j('#unsatisfiedFul_'+${consult.consultId}).bind('click',{"consultId":${consult.consultId},"chosen":0},consultVote);
	</c:forEach>
});
</script>